﻿function RegisterViewModel(model) {
    var selfModel = this;
    ko.mapping.fromJS(model, {}, selfModel);

    selfModel.FailedSubmit = ko.observable();
    
    selfModel.ConfirmPassword.hasError = ko.observable();

    selfModel.ConfirmPassword.subscribe(function (newValue) {
        selfModel.ConfirmPassword.hasError(!_.isEqual(newValue, selfModel.Password()));
    });
}